/*****************************************************************************/
/*                                                                           */
/*    Domino Operation System Communication Module                           */
/*                                                                           */
/*    Copyright (C) 2007 Laszlo Arvai                                        */
/*                                                                           */
/*    ------------------------------------------------------------------     */
/*    comRC5Receiver - RC5 standard irfrared receiver                        */
/*****************************************************************************/

#ifndef __comRC5Receiver_h
#define __comRC5Receiver_h

///////////////////////////////////////////////////////////////////////////////
// Includes
#include <krnlTypes.h>

///////////////////////////////////////////////////////////////////////////////
// Constants
#define comRC5_BIT_LENGTH 1800
#define comRC5_HALF_BIT_LENGTH (comRC5_BIT_LENGTH / 2) 
#define comRC5_MAX_PULSE_DEVIATION 400
#define comRC5_DATA_BIT_COUNT 12 // data bit count (without start bits)
#define comRC5GetCommand(x) ((x)&0x3f)
#define comRC5GetAddress(x) (((x)>>6)&0x1f)
#define comRC5GetToggleFlag(x) (((x)>>12)&0x01)

///////////////////////////////////////////////////////////////////////////////
// Function prototypes
void comRC5Init(void);
dosBool comRC5IsDataReceived(void);
dosWord comRC5GetReceivedData(void);


#endif
